<!-- HTML header for doxygen 1.8.13-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<link rel="icon" type="image/x-icon" href="favicon.ico" />
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>chigraph: lib/support/include/chi/Support/Subprocess.hpp Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="chigraphDoxygenIcon.png"/></td>
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">chigraph
   &#160;<span id="projectnumber">master</span>
   </div>
   <div id="projectbrief">Systems programming language written for beginners in LLVM</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.13 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('Subprocess_8hpp_source.html','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="headertitle">
<div class="title">Subprocess.hpp</div>  </div>
</div><!--header-->
<div class="contents">
<a href="Subprocess_8hpp.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;</div><div class="line"><a name="l00003"></a><span class="lineno">    3</span>&#160;<span class="preprocessor">#pragma once</span></div><div class="line"><a name="l00004"></a><span class="lineno">    4</span>&#160;</div><div class="line"><a name="l00005"></a><span class="lineno">    5</span>&#160;<span class="preprocessor">#ifndef CHI_SUBPROCESS_HPP</span></div><div class="line"><a name="l00006"></a><span class="lineno">    6</span>&#160;<span class="preprocessor">#define CHI_SUBPROCESS_HPP</span></div><div class="line"><a name="l00007"></a><span class="lineno">    7</span>&#160;</div><div class="line"><a name="l00008"></a><span class="lineno">    8</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="support_2include_2chi_2Support_2Fwd_8hpp.html">chi/Support/Fwd.hpp</a>&quot;</span></div><div class="line"><a name="l00009"></a><span class="lineno">    9</span>&#160;</div><div class="line"><a name="l00010"></a><span class="lineno">   10</span>&#160;<span class="preprocessor">#include &lt;boost/filesystem/operations.hpp&gt;</span></div><div class="line"><a name="l00011"></a><span class="lineno">   11</span>&#160;<span class="preprocessor">#include &lt;boost/filesystem/path.hpp&gt;</span></div><div class="line"><a name="l00012"></a><span class="lineno">   12</span>&#160;<span class="preprocessor">#include &lt;boost/optional.hpp&gt;</span></div><div class="line"><a name="l00013"></a><span class="lineno">   13</span>&#160;</div><div class="line"><a name="l00014"></a><span class="lineno">   14</span>&#160;<span class="preprocessor">#include &lt;chrono&gt;</span></div><div class="line"><a name="l00015"></a><span class="lineno">   15</span>&#160;<span class="preprocessor">#include &lt;string&gt;</span></div><div class="line"><a name="l00016"></a><span class="lineno">   16</span>&#160;<span class="preprocessor">#include &lt;vector&gt;</span></div><div class="line"><a name="l00017"></a><span class="lineno">   17</span>&#160;</div><div class="line"><a name="l00018"></a><span class="lineno">   18</span>&#160;<span class="keyword">namespace </span><a class="code" href="namespacechi.html">chi</a> {</div><div class="line"><a name="l00019"></a><span class="lineno">   19</span>&#160;</div><div class="line"><a name="l00052"></a><span class="lineno"><a class="line" href="structchi_1_1Subprocess.html">   52</a></span>&#160;<span class="keyword">struct </span><a class="code" href="structchi_1_1Subprocess.html">Subprocess</a> {</div><div class="line"><a name="l00054"></a><span class="lineno"><a class="line" href="structchi_1_1Subprocess.html#a7ae98dd49171bcffb8d3a64714b4f5b1">   54</a></span>&#160;    <span class="keyword">using</span> <a class="code" href="structchi_1_1Subprocess.html#a7ae98dd49171bcffb8d3a64714b4f5b1">pipeHandler</a> = std::function&lt;void(const char* data, size_t size)&gt;;</div><div class="line"><a name="l00055"></a><span class="lineno">   55</span>&#160;</div><div class="line"><a name="l00058"></a><span class="lineno">   58</span>&#160;    <a class="code" href="structchi_1_1Subprocess.html#a650660115d11ccf9f4d0e3569554115e">Subprocess</a>(<span class="keyword">const</span> boost::filesystem::path&amp; pathToExecutable);</div><div class="line"><a name="l00059"></a><span class="lineno">   59</span>&#160;</div><div class="line"><a name="l00061"></a><span class="lineno">   61</span>&#160;    <a class="code" href="structchi_1_1Subprocess.html#a9c0188c9acdac32fa874f9539818b99b">~Subprocess</a>();</div><div class="line"><a name="l00062"></a><span class="lineno">   62</span>&#160;</div><div class="line"><a name="l00068"></a><span class="lineno">   68</span>&#160;</div><div class="line"><a name="l00074"></a><span class="lineno">   74</span>&#160;    <span class="keyword">template</span> &lt;<span class="keyword">typename</span> ForwardIterator&gt;</div><div class="line"><a name="l00075"></a><span class="lineno"><a class="line" href="structchi_1_1Subprocess.html#a38101f1406d62b1dc386072f576b990f">   75</a></span>&#160;    <span class="keywordtype">void</span> <a class="code" href="structchi_1_1Subprocess.html#a38101f1406d62b1dc386072f576b990f">setArguments</a>(<span class="keyword">const</span> ForwardIterator&amp; begin, <span class="keyword">const</span> ForwardIterator&amp; end) {</div><div class="line"><a name="l00076"></a><span class="lineno">   76</span>&#160;        <span class="comment">// make sure the iterator type is good to go</span></div><div class="line"><a name="l00077"></a><span class="lineno">   77</span>&#160;        static_assert(</div><div class="line"><a name="l00078"></a><span class="lineno">   78</span>&#160;            std::is_convertible&lt;<span class="keyword">typename</span> std::iterator_traits&lt;ForwardIterator&gt;::value_type,</div><div class="line"><a name="l00079"></a><span class="lineno">   79</span>&#160;                                std::string&gt;::value,</div><div class="line"><a name="l00080"></a><span class="lineno">   80</span>&#160;            <span class="stringliteral">&quot;Cannot run setArguments with iterators not convertable to std::string&quot;</span>);</div><div class="line"><a name="l00081"></a><span class="lineno">   81</span>&#160;</div><div class="line"><a name="l00082"></a><span class="lineno">   82</span>&#160;        assert(!<a class="code" href="structchi_1_1Subprocess.html#a9b2f4ecd9a0239232deaf3ff46c48bf0">started</a>() &amp;&amp; <span class="stringliteral">&quot;Cannot set arguments after start() has been called&quot;</span>);</div><div class="line"><a name="l00083"></a><span class="lineno">   83</span>&#160;</div><div class="line"><a name="l00084"></a><span class="lineno">   84</span>&#160;        mArguments = std::vector&lt;std::string&gt;(begin, end);</div><div class="line"><a name="l00085"></a><span class="lineno">   85</span>&#160;    }</div><div class="line"><a name="l00086"></a><span class="lineno">   86</span>&#160;</div><div class="line"><a name="l00090"></a><span class="lineno">   90</span>&#160;    <span class="keyword">template</span> &lt;<span class="keyword">typename</span> Range&gt;</div><div class="line"><a name="l00091"></a><span class="lineno"><a class="line" href="structchi_1_1Subprocess.html#a8a66d790bd0984727c5a45e00fb05f58">   91</a></span>&#160;    <span class="keywordtype">void</span> <a class="code" href="structchi_1_1Subprocess.html#a8a66d790bd0984727c5a45e00fb05f58">setArguments</a>(Range&amp;&amp; range) {</div><div class="line"><a name="l00092"></a><span class="lineno">   92</span>&#160;        <a class="code" href="structchi_1_1Subprocess.html#a38101f1406d62b1dc386072f576b990f">setArguments</a>(std::forward&lt;Range&gt;(range).begin(), std::forward&lt;Range&gt;(range).end());</div><div class="line"><a name="l00093"></a><span class="lineno">   93</span>&#160;    }</div><div class="line"><a name="l00094"></a><span class="lineno">   94</span>&#160;</div><div class="line"><a name="l00098"></a><span class="lineno"><a class="line" href="structchi_1_1Subprocess.html#ae280118b573601a288c6c8eaac834d6c">   98</a></span>&#160;    <span class="keywordtype">void</span> <a class="code" href="structchi_1_1Subprocess.html#ae280118b573601a288c6c8eaac834d6c">setArguments</a>(std::initializer_list&lt;const char*&gt; init) {</div><div class="line"><a name="l00099"></a><span class="lineno">   99</span>&#160;        <a class="code" href="structchi_1_1Subprocess.html#a38101f1406d62b1dc386072f576b990f">setArguments</a>(init.begin(), init.end());</div><div class="line"><a name="l00100"></a><span class="lineno">  100</span>&#160;    }</div><div class="line"><a name="l00101"></a><span class="lineno">  101</span>&#160;</div><div class="line"><a name="l00104"></a><span class="lineno"><a class="line" href="structchi_1_1Subprocess.html#a889d6dcbd8488df673b6e12c29447e7c">  104</a></span>&#160;    <span class="keyword">const</span> std::vector&lt;std::string&gt;&amp; <a class="code" href="structchi_1_1Subprocess.html#a889d6dcbd8488df673b6e12c29447e7c">arguments</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> mArguments; }</div><div class="line"><a name="l00105"></a><span class="lineno">  105</span>&#160;</div><div class="line"><a name="l00111"></a><span class="lineno"><a class="line" href="structchi_1_1Subprocess.html#a8a74fc88aa957ff035f446495b7c7a7a">  111</a></span>&#160;    <span class="keywordtype">void</span> <a class="code" href="structchi_1_1Subprocess.html#a8a74fc88aa957ff035f446495b7c7a7a">attachToStdOut</a>(<a class="code" href="structchi_1_1Subprocess.html#a7ae98dd49171bcffb8d3a64714b4f5b1">pipeHandler</a> stdOutHandler) {</div><div class="line"><a name="l00112"></a><span class="lineno">  112</span>&#160;        assert(!<a class="code" href="structchi_1_1Subprocess.html#a9b2f4ecd9a0239232deaf3ff46c48bf0">started</a>() &amp;&amp;</div><div class="line"><a name="l00113"></a><span class="lineno">  113</span>&#160;               <span class="stringliteral">&quot;Cannot attach a differnt function to stdout after start() has been called&quot;</span>);</div><div class="line"><a name="l00114"></a><span class="lineno">  114</span>&#160;        mStdOutHandler = stdOutHandler;</div><div class="line"><a name="l00115"></a><span class="lineno">  115</span>&#160;    }</div><div class="line"><a name="l00116"></a><span class="lineno">  116</span>&#160;</div><div class="line"><a name="l00122"></a><span class="lineno"><a class="line" href="structchi_1_1Subprocess.html#ad1c5751c1ef62ae1020aafdbeee36fbb">  122</a></span>&#160;    <span class="keywordtype">void</span> <a class="code" href="structchi_1_1Subprocess.html#ad1c5751c1ef62ae1020aafdbeee36fbb">attachToStdErr</a>(<a class="code" href="structchi_1_1Subprocess.html#a7ae98dd49171bcffb8d3a64714b4f5b1">pipeHandler</a> stdErrHandler) {</div><div class="line"><a name="l00123"></a><span class="lineno">  123</span>&#160;        assert(!<a class="code" href="structchi_1_1Subprocess.html#a9b2f4ecd9a0239232deaf3ff46c48bf0">started</a>() &amp;&amp;</div><div class="line"><a name="l00124"></a><span class="lineno">  124</span>&#160;               <span class="stringliteral">&quot;Cannot attach a differnt function to stderr after start() has been called&quot;</span>);</div><div class="line"><a name="l00125"></a><span class="lineno">  125</span>&#160;        mStdErrHandler = stdErrHandler;</div><div class="line"><a name="l00126"></a><span class="lineno">  126</span>&#160;    }</div><div class="line"><a name="l00127"></a><span class="lineno">  127</span>&#160;</div><div class="line"><a name="l00135"></a><span class="lineno"><a class="line" href="structchi_1_1Subprocess.html#a1b08709bbb208a970888ebcccc58906c">  135</a></span>&#160;    <span class="keywordtype">void</span> <a class="code" href="structchi_1_1Subprocess.html#a1b08709bbb208a970888ebcccc58906c">attachStringToStdOut</a>(std::string&amp; str) {</div><div class="line"><a name="l00136"></a><span class="lineno">  136</span>&#160;        <a class="code" href="structchi_1_1Subprocess.html#a8a74fc88aa957ff035f446495b7c7a7a">attachToStdOut</a>([&amp;str](<span class="keyword">const</span> <span class="keywordtype">char</span>* data, <span class="keywordtype">size_t</span> size) { str.append(data, size); });</div><div class="line"><a name="l00137"></a><span class="lineno">  137</span>&#160;    }</div><div class="line"><a name="l00138"></a><span class="lineno">  138</span>&#160;</div><div class="line"><a name="l00146"></a><span class="lineno"><a class="line" href="structchi_1_1Subprocess.html#a3f07d6a6acf5e139c5161210ae0726cb">  146</a></span>&#160;    <span class="keywordtype">void</span> <a class="code" href="structchi_1_1Subprocess.html#a3f07d6a6acf5e139c5161210ae0726cb">attachStringToStdErr</a>(std::string&amp; str) {</div><div class="line"><a name="l00147"></a><span class="lineno">  147</span>&#160;        <a class="code" href="structchi_1_1Subprocess.html#ad1c5751c1ef62ae1020aafdbeee36fbb">attachToStdErr</a>([&amp;str](<span class="keyword">const</span> <span class="keywordtype">char</span>* data, <span class="keywordtype">size_t</span> size) { str.append(data, size); });</div><div class="line"><a name="l00148"></a><span class="lineno">  148</span>&#160;    }</div><div class="line"><a name="l00149"></a><span class="lineno">  149</span>&#160;</div><div class="line"><a name="l00153"></a><span class="lineno"><a class="line" href="structchi_1_1Subprocess.html#ac15b0c5788d615c6cc9badd58bfa57b0">  153</a></span>&#160;    <span class="keywordtype">void</span> <a class="code" href="structchi_1_1Subprocess.html#ac15b0c5788d615c6cc9badd58bfa57b0">setWorkingDirectory</a>(boost::filesystem::path newWd) { mWorkingDir = std::move(newWd); }</div><div class="line"><a name="l00154"></a><span class="lineno">  154</span>&#160;</div><div class="line"><a name="l00156"></a><span class="lineno">  156</span>&#160;</div><div class="line"><a name="l00162"></a><span class="lineno">  162</span>&#160;    <a class="code" href="structchi_1_1Result.html">Result</a> <a class="code" href="structchi_1_1Subprocess.html#a1a8a312f1f2279a6b0290c3794968136">start</a>();</div><div class="line"><a name="l00163"></a><span class="lineno">  163</span>&#160;</div><div class="line"><a name="l00166"></a><span class="lineno"><a class="line" href="structchi_1_1Subprocess.html#a9b2f4ecd9a0239232deaf3ff46c48bf0">  166</a></span>&#160;    <span class="keywordtype">bool</span> <a class="code" href="structchi_1_1Subprocess.html#a9b2f4ecd9a0239232deaf3ff46c48bf0">started</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> mStarted; }</div><div class="line"><a name="l00167"></a><span class="lineno">  167</span>&#160;</div><div class="line"><a name="l00171"></a><span class="lineno">  171</span>&#160;</div><div class="line"><a name="l00177"></a><span class="lineno">  177</span>&#160;    <a class="code" href="structchi_1_1Result.html">Result</a> <a class="code" href="structchi_1_1Subprocess.html#a62114d525126e682028af5a906f771a6">pushToStdIn</a>(<span class="keyword">const</span> <span class="keywordtype">char</span>* data, <span class="keywordtype">size_t</span> size);</div><div class="line"><a name="l00178"></a><span class="lineno">  178</span>&#160;</div><div class="line"><a name="l00184"></a><span class="lineno">  184</span>&#160;    <a class="code" href="structchi_1_1Result.html">Result</a> <a class="code" href="structchi_1_1Subprocess.html#a45fd483d620609100cdd6065ce4751f2">closeStdIn</a>();</div><div class="line"><a name="l00185"></a><span class="lineno">  185</span>&#160;</div><div class="line"><a name="l00188"></a><span class="lineno"><a class="line" href="structchi_1_1Subprocess.html#a9497b25fd496cd7a0ad464dfeb6e242d">  188</a></span>&#160;    <span class="keywordtype">bool</span> <a class="code" href="structchi_1_1Subprocess.html#a9497b25fd496cd7a0ad464dfeb6e242d">isStdInClosed</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> mStdInClosed; }</div><div class="line"><a name="l00189"></a><span class="lineno">  189</span>&#160;</div><div class="line"><a name="l00193"></a><span class="lineno">  193</span>&#160;    <span class="keywordtype">void</span> <a class="code" href="structchi_1_1Subprocess.html#aaaf29ada876d6088621cc0d8c84c7e47">kill</a>();</div><div class="line"><a name="l00194"></a><span class="lineno">  194</span>&#160;</div><div class="line"><a name="l00197"></a><span class="lineno">  197</span>&#160;    <span class="keywordtype">void</span> <a class="code" href="structchi_1_1Subprocess.html#aeea9178c987445e45d97e4d4210a983c">wait</a>();</div><div class="line"><a name="l00198"></a><span class="lineno">  198</span>&#160;</div><div class="line"><a name="l00202"></a><span class="lineno">  202</span>&#160;    <span class="keywordtype">int</span> <a class="code" href="structchi_1_1Subprocess.html#a2f57bcbe46b93798d8ca769dc7aab4c9">exitCode</a>();</div><div class="line"><a name="l00203"></a><span class="lineno">  203</span>&#160;</div><div class="line"><a name="l00207"></a><span class="lineno">  207</span>&#160;    <span class="keywordtype">bool</span> <a class="code" href="structchi_1_1Subprocess.html#ab07c04b4c4ef24cde067e11faf0837ce">running</a>();</div><div class="line"><a name="l00208"></a><span class="lineno">  208</span>&#160;</div><div class="line"><a name="l00210"></a><span class="lineno">  210</span>&#160;</div><div class="line"><a name="l00211"></a><span class="lineno">  211</span>&#160;<span class="keyword">private</span>:</div><div class="line"><a name="l00212"></a><span class="lineno">  212</span>&#160;    <span class="keyword">struct </span>Implementation;</div><div class="line"><a name="l00213"></a><span class="lineno">  213</span>&#160;    std::unique_ptr&lt;Implementation&gt; mPimpl;</div><div class="line"><a name="l00214"></a><span class="lineno">  214</span>&#160;</div><div class="line"><a name="l00215"></a><span class="lineno">  215</span>&#160;    std::vector&lt;std::string&gt; mArguments;</div><div class="line"><a name="l00216"></a><span class="lineno">  216</span>&#160;</div><div class="line"><a name="l00217"></a><span class="lineno">  217</span>&#160;    <a class="code" href="structchi_1_1Subprocess.html#a7ae98dd49171bcffb8d3a64714b4f5b1">pipeHandler</a> mStdOutHandler;</div><div class="line"><a name="l00218"></a><span class="lineno">  218</span>&#160;    <a class="code" href="structchi_1_1Subprocess.html#a7ae98dd49171bcffb8d3a64714b4f5b1">pipeHandler</a> mStdErrHandler;</div><div class="line"><a name="l00219"></a><span class="lineno">  219</span>&#160;</div><div class="line"><a name="l00220"></a><span class="lineno">  220</span>&#160;    boost::filesystem::path mExePath;</div><div class="line"><a name="l00221"></a><span class="lineno">  221</span>&#160;</div><div class="line"><a name="l00222"></a><span class="lineno">  222</span>&#160;    boost::filesystem::path mWorkingDir = boost::filesystem::current_path();</div><div class="line"><a name="l00223"></a><span class="lineno">  223</span>&#160;</div><div class="line"><a name="l00224"></a><span class="lineno">  224</span>&#160;    <span class="keywordtype">bool</span> mStarted     = <span class="keyword">false</span>;</div><div class="line"><a name="l00225"></a><span class="lineno">  225</span>&#160;    <span class="keywordtype">bool</span> mStdInClosed = <span class="keyword">false</span>;</div><div class="line"><a name="l00226"></a><span class="lineno">  226</span>&#160;</div><div class="line"><a name="l00227"></a><span class="lineno">  227</span>&#160;    boost::optional&lt;int&gt; mExitCode;</div><div class="line"><a name="l00228"></a><span class="lineno">  228</span>&#160;};</div><div class="line"><a name="l00229"></a><span class="lineno">  229</span>&#160;</div><div class="line"><a name="l00231"></a><span class="lineno">  231</span>&#160;</div><div class="line"><a name="l00232"></a><span class="lineno">  232</span>&#160;}  <span class="comment">// namespace chi</span></div><div class="line"><a name="l00233"></a><span class="lineno">  233</span>&#160;</div><div class="line"><a name="l00234"></a><span class="lineno">  234</span>&#160;<span class="preprocessor">#endif  // CHI_SUBPROCESS_HPP</span></div><div class="ttc" id="structchi_1_1Subprocess_html_a1b08709bbb208a970888ebcccc58906c"><div class="ttname"><a href="structchi_1_1Subprocess.html#a1b08709bbb208a970888ebcccc58906c">chi::Subprocess::attachStringToStdOut</a></div><div class="ttdeci">void attachStringToStdOut(std::string &amp;str)</div><div class="ttdoc">Attach a string to stdout. </div><div class="ttdef"><b>Definition:</b> <a href="Subprocess_8hpp_source.html#l00135">Subprocess.hpp:135</a></div></div>
<div class="ttc" id="structchi_1_1Subprocess_html_a9c0188c9acdac32fa874f9539818b99b"><div class="ttname"><a href="structchi_1_1Subprocess.html#a9c0188c9acdac32fa874f9539818b99b">chi::Subprocess::~Subprocess</a></div><div class="ttdeci">~Subprocess()</div><div class="ttdoc">Wait for the process to exit and close all open handles. </div><div class="ttdef"><b>Definition:</b> <a href="Subprocess_8cpp_source.html#l00353">Subprocess.cpp:353</a></div></div>
<div class="ttc" id="structchi_1_1Subprocess_html_aeea9178c987445e45d97e4d4210a983c"><div class="ttname"><a href="structchi_1_1Subprocess.html#aeea9178c987445e45d97e4d4210a983c">chi::Subprocess::wait</a></div><div class="ttdeci">void wait()</div><div class="ttdoc">Wait for the process to complete. </div><div class="ttdef"><b>Definition:</b> <a href="Subprocess_8cpp_source.html#l00525">Subprocess.cpp:525</a></div></div>
<div class="ttc" id="structchi_1_1Subprocess_html_a8a74fc88aa957ff035f446495b7c7a7a"><div class="ttname"><a href="structchi_1_1Subprocess.html#a8a74fc88aa957ff035f446495b7c7a7a">chi::Subprocess::attachToStdOut</a></div><div class="ttdeci">void attachToStdOut(pipeHandler stdOutHandler)</div><div class="ttdoc">Attach a function handler to the child stdout. </div><div class="ttdef"><b>Definition:</b> <a href="Subprocess_8hpp_source.html#l00111">Subprocess.hpp:111</a></div></div>
<div class="ttc" id="structchi_1_1Subprocess_html_a2f57bcbe46b93798d8ca769dc7aab4c9"><div class="ttname"><a href="structchi_1_1Subprocess.html#a2f57bcbe46b93798d8ca769dc7aab4c9">chi::Subprocess::exitCode</a></div><div class="ttdeci">int exitCode()</div><div class="ttdoc">Wait and gets the exit code. </div><div class="ttdef"><b>Definition:</b> <a href="Subprocess_8cpp_source.html#l00534">Subprocess.cpp:534</a></div></div>
<div class="ttc" id="structchi_1_1Subprocess_html_a3f07d6a6acf5e139c5161210ae0726cb"><div class="ttname"><a href="structchi_1_1Subprocess.html#a3f07d6a6acf5e139c5161210ae0726cb">chi::Subprocess::attachStringToStdErr</a></div><div class="ttdeci">void attachStringToStdErr(std::string &amp;str)</div><div class="ttdoc">Attach a string to stderr. </div><div class="ttdef"><b>Definition:</b> <a href="Subprocess_8hpp_source.html#l00146">Subprocess.hpp:146</a></div></div>
<div class="ttc" id="structchi_1_1Subprocess_html_a889d6dcbd8488df673b6e12c29447e7c"><div class="ttname"><a href="structchi_1_1Subprocess.html#a889d6dcbd8488df673b6e12c29447e7c">chi::Subprocess::arguments</a></div><div class="ttdeci">const std::vector&lt; std::string &gt; &amp; arguments() const</div><div class="ttdoc">Get the currently set arguments for the program. </div><div class="ttdef"><b>Definition:</b> <a href="Subprocess_8hpp_source.html#l00104">Subprocess.hpp:104</a></div></div>
<div class="ttc" id="structchi_1_1Subprocess_html_ad1c5751c1ef62ae1020aafdbeee36fbb"><div class="ttname"><a href="structchi_1_1Subprocess.html#ad1c5751c1ef62ae1020aafdbeee36fbb">chi::Subprocess::attachToStdErr</a></div><div class="ttdeci">void attachToStdErr(pipeHandler stdErrHandler)</div><div class="ttdoc">Attach a function handler to the child stderr. </div><div class="ttdef"><b>Definition:</b> <a href="Subprocess_8hpp_source.html#l00122">Subprocess.hpp:122</a></div></div>
<div class="ttc" id="structchi_1_1Subprocess_html_a45fd483d620609100cdd6065ce4751f2"><div class="ttname"><a href="structchi_1_1Subprocess.html#a45fd483d620609100cdd6065ce4751f2">chi::Subprocess::closeStdIn</a></div><div class="ttdeci">Result closeStdIn()</div><div class="ttdoc">Close the STDIN stream (send an EOF) </div><div class="ttdef"><b>Definition:</b> <a href="Subprocess_8cpp_source.html#l00388">Subprocess.cpp:388</a></div></div>
<div class="ttc" id="structchi_1_1Subprocess_html_a650660115d11ccf9f4d0e3569554115e"><div class="ttname"><a href="structchi_1_1Subprocess.html#a650660115d11ccf9f4d0e3569554115e">chi::Subprocess::Subprocess</a></div><div class="ttdeci">Subprocess(const boost::filesystem::path &amp;pathToExecutable)</div><div class="ttdoc">Construct a Subprocess with a path to an executable. </div><div class="ttdef"><b>Definition:</b> <a href="Subprocess_8cpp_source.html#l00572">Subprocess.cpp:572</a></div></div>
<div class="ttc" id="structchi_1_1Subprocess_html_a9497b25fd496cd7a0ad464dfeb6e242d"><div class="ttname"><a href="structchi_1_1Subprocess.html#a9497b25fd496cd7a0ad464dfeb6e242d">chi::Subprocess::isStdInClosed</a></div><div class="ttdeci">bool isStdInClosed() const</div><div class="ttdoc">Checks if the stdin is closed. </div><div class="ttdef"><b>Definition:</b> <a href="Subprocess_8hpp_source.html#l00188">Subprocess.hpp:188</a></div></div>
<div class="ttc" id="structchi_1_1Subprocess_html_a62114d525126e682028af5a906f771a6"><div class="ttname"><a href="structchi_1_1Subprocess.html#a62114d525126e682028af5a906f771a6">chi::Subprocess::pushToStdIn</a></div><div class="ttdeci">Result pushToStdIn(const char *data, size_t size)</div><div class="ttdoc">Pushes data to the stdin stream of the child process. </div><div class="ttdef"><b>Definition:</b> <a href="Subprocess_8cpp_source.html#l00374">Subprocess.cpp:374</a></div></div>
<div class="ttc" id="structchi_1_1Subprocess_html"><div class="ttname"><a href="structchi_1_1Subprocess.html">chi::Subprocess</a></div><div class="ttdoc">Provides an platform-independent abstraction for creating subprocesses. </div><div class="ttdef"><b>Definition:</b> <a href="Subprocess_8hpp_source.html#l00052">Subprocess.hpp:52</a></div></div>
<div class="ttc" id="structchi_1_1Subprocess_html_ab07c04b4c4ef24cde067e11faf0837ce"><div class="ttname"><a href="structchi_1_1Subprocess.html#ab07c04b4c4ef24cde067e11faf0837ce">chi::Subprocess::running</a></div><div class="ttdeci">bool running()</div><div class="ttdoc">Check if the process is still running. </div><div class="ttdef"><b>Definition:</b> <a href="Subprocess_8cpp_source.html#l00550">Subprocess.cpp:550</a></div></div>
<div class="ttc" id="support_2include_2chi_2Support_2Fwd_8hpp_html"><div class="ttname"><a href="support_2include_2chi_2Support_2Fwd_8hpp.html">Fwd.hpp</a></div></div>
<div class="ttc" id="structchi_1_1Subprocess_html_a1a8a312f1f2279a6b0290c3794968136"><div class="ttname"><a href="structchi_1_1Subprocess.html#a1a8a312f1f2279a6b0290c3794968136">chi::Subprocess::start</a></div><div class="ttdeci">Result start()</div><div class="ttdoc">Start the process. </div><div class="ttdef"><b>Definition:</b> <a href="Subprocess_8cpp_source.html#l00405">Subprocess.cpp:405</a></div></div>
<div class="ttc" id="structchi_1_1Subprocess_html_a38101f1406d62b1dc386072f576b990f"><div class="ttname"><a href="structchi_1_1Subprocess.html#a38101f1406d62b1dc386072f576b990f">chi::Subprocess::setArguments</a></div><div class="ttdeci">void setArguments(const ForwardIterator &amp;begin, const ForwardIterator &amp;end)</div><div class="ttdoc">Set the arguments for the program with a begin and end iterator. </div><div class="ttdef"><b>Definition:</b> <a href="Subprocess_8hpp_source.html#l00075">Subprocess.hpp:75</a></div></div>
<div class="ttc" id="structchi_1_1Subprocess_html_aaaf29ada876d6088621cc0d8c84c7e47"><div class="ttname"><a href="structchi_1_1Subprocess.html#aaaf29ada876d6088621cc0d8c84c7e47">chi::Subprocess::kill</a></div><div class="ttdeci">void kill()</div><div class="ttdoc">Kill the child process On POSIX, this sends SIGINT. </div><div class="ttdef"><b>Definition:</b> <a href="Subprocess_8cpp_source.html#l00520">Subprocess.cpp:520</a></div></div>
<div class="ttc" id="structchi_1_1Subprocess_html_a8a66d790bd0984727c5a45e00fb05f58"><div class="ttname"><a href="structchi_1_1Subprocess.html#a8a66d790bd0984727c5a45e00fb05f58">chi::Subprocess::setArguments</a></div><div class="ttdeci">void setArguments(Range &amp;&amp;range)</div><div class="ttdoc">Set the arguments for the program with a range. </div><div class="ttdef"><b>Definition:</b> <a href="Subprocess_8hpp_source.html#l00091">Subprocess.hpp:91</a></div></div>
<div class="ttc" id="structchi_1_1Subprocess_html_ac15b0c5788d615c6cc9badd58bfa57b0"><div class="ttname"><a href="structchi_1_1Subprocess.html#ac15b0c5788d615c6cc9badd58bfa57b0">chi::Subprocess::setWorkingDirectory</a></div><div class="ttdeci">void setWorkingDirectory(boost::filesystem::path newWd)</div><div class="ttdoc">Set the working directory of the process. </div><div class="ttdef"><b>Definition:</b> <a href="Subprocess_8hpp_source.html#l00153">Subprocess.hpp:153</a></div></div>
<div class="ttc" id="structchi_1_1Subprocess_html_a9b2f4ecd9a0239232deaf3ff46c48bf0"><div class="ttname"><a href="structchi_1_1Subprocess.html#a9b2f4ecd9a0239232deaf3ff46c48bf0">chi::Subprocess::started</a></div><div class="ttdeci">bool started() const</div><div class="ttdoc">Check if the child has started (start() has been called) </div><div class="ttdef"><b>Definition:</b> <a href="Subprocess_8hpp_source.html#l00166">Subprocess.hpp:166</a></div></div>
<div class="ttc" id="namespacechi_html"><div class="ttname"><a href="namespacechi.html">chi</a></div><div class="ttdoc">The namespace where chigraph lives. </div><div class="ttdef"><b>Definition:</b> <a href="BitcodeParser_8hpp_source.html#l00012">BitcodeParser.hpp:12</a></div></div>
<div class="ttc" id="structchi_1_1Subprocess_html_ae280118b573601a288c6c8eaac834d6c"><div class="ttname"><a href="structchi_1_1Subprocess.html#ae280118b573601a288c6c8eaac834d6c">chi::Subprocess::setArguments</a></div><div class="ttdeci">void setArguments(std::initializer_list&lt; const char *&gt; init)</div><div class="ttdoc">Set the arguments for the program with an initializer_list. </div><div class="ttdef"><b>Definition:</b> <a href="Subprocess_8hpp_source.html#l00098">Subprocess.hpp:98</a></div></div>
<div class="ttc" id="structchi_1_1Result_html"><div class="ttname"><a href="structchi_1_1Result.html">chi::Result</a></div><div class="ttdoc">The result object, used for identifiying errors with good diagnostics. </div><div class="ttdef"><b>Definition:</b> <a href="Result_8hpp_source.html#l00072">Result.hpp:72</a></div></div>
<div class="ttc" id="structchi_1_1Subprocess_html_a7ae98dd49171bcffb8d3a64714b4f5b1"><div class="ttname"><a href="structchi_1_1Subprocess.html#a7ae98dd49171bcffb8d3a64714b4f5b1">chi::Subprocess::pipeHandler</a></div><div class="ttdeci">std::function&lt; void(const char *data, size_t size)&gt; pipeHandler</div><div class="ttdoc">The function type for recieving data from pipes. </div><div class="ttdef"><b>Definition:</b> <a href="Subprocess_8hpp_source.html#l00054">Subprocess.hpp:54</a></div></div>
</div><!-- fragment --></div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="dir_97aefd0d527b934f1d99a682da8fe6a9.html">lib</a></li><li class="navelem"><a class="el" href="dir_2e3059805f6f515f917d8ef98610afb5.html">support</a></li><li class="navelem"><a class="el" href="dir_8f6158c6375c7a928f205956f43cc53b.html">include</a></li><li class="navelem"><a class="el" href="dir_15506f16d8a27e5f24c5f11d43b99347.html">chi</a></li><li class="navelem"><a class="el" href="dir_69eae05ff7476524364d958d7a05777f.html">Support</a></li><li class="navelem"><a class="el" href="Subprocess_8hpp.html">Subprocess.hpp</a></li>
    <li class="footer">Generated on Sat Sep 16 2017 17:41:35 for chigraph by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.13 </li>
  </ul>
</div>
</body>
</html>
